package eraserhead.entity;

/**
 * Class for a closed Decision Lines Event
 * @author Quanquan
 * @author Greg
 * @author Kevin
 */
public class ClosedDecision extends Decision {
	
	/**
	 * Create a new {@link ClosedDecision}
	 * @param numRounds Number of rounds
	 * @param numLines Number of lines/users
	 */
	public ClosedDecision(int numRounds, int numLines) {
		super(numRounds, numLines);
	}
	
	public boolean isOpen() {
		return false;
	}
	
	/*@Override
	public boolean isReady() {
		for (int i = 0; i < numUsers; i++) {
			if (lines.get(i).choice.length() == 0) {
				errorMsg = "Please fill in all the choices.";
				return false;
			}
		}
		return true;
	}*/
	
	/*@Override
	public boolean resetNumUsers(int i) {
		// don't want to reset for a closed event
		// so do nothing
		numUsers = users;
		return true;
	}*/
	
	@Override
	public void updateHashMap() {
		// do nothing
	}
	// USE setChoice instead?
	
	@Override
	public boolean[] userGiveChoice() {
		 
		 
		 
		 boolean[] canEdit = new boolean[numUsers];
		 boolean modStatus = (signedInAs == null) ? false : signedInAs.getModeratorStatus();
		 if (modStatus)
		 {
		  		for(int i = 0; i < numUsers; i++)
		  		{
		  			canEdit[i] = true; 
		  		}
		  		errorMsg = "For each line, fill in a unique choice, then hit enter";
		 }
		 else
		 {
		  		for(int i = 0; i < numUsers; i++)
		  		{
		  			canEdit[i] = false; 
		  		}
		  		errorMsg = "Please wait for the moderator to set the choices";
		 }
		 return canEdit;
		  
		  
		  
		  
	}	
}
